#ifndef __COMMON_SERVER_HPP__
#define __COMMON_SERVER_HPP__

#include "stdafx.h"
#include "selector.hpp"
#include "parameters.hpp"
using namespace std;

class commprd_adapter;

class commsrv_adapter :public selector_item {

public:
	char server_ip[ MAX_IP_LENGTH ];
	int server_port;

	commprd_adapter * producer_p;

	BOOL inited;
	BOOL connected;

	BOOL quit_event;
public:
	commsrv_adapter();
	virtual ~commsrv_adapter();

	virtual BOOL initialize( commprd_adapter * prod_p );
	virtual void uninit();
	
	virtual BOOL connect();
	virtual void disconnect();
	virtual BOOL is_server_quit();

	virtual BOOL _register() {return TRUE;}

	virtual void quit();
	
	virtual BOOL configure( STUBPARAM params );
	
	virtual void set_proxy_fd( selector * sel_p ) {return ;}

	virtual void check_state() {return;}
	virtual void check_proxy() {return;}

	virtual BOOL set_producer( commprd_adapter * producer);

	virtual BOOL send_channel_status_notify( int channel, int channel_type, int status ) { return TRUE;};
};

#endif
